package com.action;

import java.util.List;

/**
 * Created by lirance on 16/4/14.
 */
public class searchWebAction extends BaseAction {
    private List serviceList;
    private int wid;
    private String wname;

    public List getServiceList() {
        return serviceList;
    }

    public void setServiceList(List serviceList) {
        this.serviceList = serviceList;
    }

    public int getWid() {
        return wid;
    }

    public void setWid(int wid) {
        this.wid = wid;
    }

    public String getWname() {
        return wname;
    }

    public void setWname(String wname) {
        this.wname = wname;
    }

    @Override
    public String execute() throws Exception {
        try {
            this.setServiceList(this.getAllService().getGetServicesService().getEntitiesbyID(wid));
        } catch (Exception e) {
            this.setServiceList(this.getAllService().getGetUsersService().getEntitiesbyIp(wname));
        }

        return SUCCESS;
    }
}
